
<template>
<div >
  <el-table
    :data="tbl_card_replacement"
    height="500"
    border
    style="width: 100%">
    <el-table-column
      prop="user_id"
      label="用户ID"
      height="50"
      style="width: 15%">
    </el-table-column>
    <el-table-column
      prop="cr_id"
      label="打卡ID"
      height="50"
      style="width: 15%">
    </el-table-column>
    
    <el-table-column
      fixed
      height="50"
      prop="user_name"
      label="打卡人姓名"
     style="width: 15%">
    </el-table-column>
    
<el-table-column
height="50"
      prop="cr_date"
      label="打卡时间"
     style="width: 15%">
    </el-table-column>
    <el-table-column
    height="50"
      fixed="right"
      label="操作"
     style="width: 15%">
      <template slot-scope="scope">
   <el-link @click="look(scope.row)">查看<i class="el-icon-view el-icon--right"></i> </el-link>
      </template>
       </el-table-column>
  </el-table>
  </div>
</template>
<script>


export default {
  
  data(){
  return{
tbl_card_replacement:[],
   name:{
     user_name:'张三'
   } 
  }
},
methods:{
indexs:function(){
              this.$http.post('/cc',
              {
                user_name:this.name.user_name
                })
                .then(res=>{
                 
                    if(res.data.code<0){
                     this.$message(res.data.msg);
                    }else{
                      
                      this.$message(res.data.msg);
                      this.tbl_card_replacement=res.data.data
                    }
                   
                })
              
            
   },
look:function(r){
console.log(r)
sessionStorage.setItem("leave",r)
this.$router.push("/home/myApply/processsetcard")
}

},
 mounted(){
            //自动加载indexs方法
            this.indexs();
        }

}
</script>
